package 设计模式.原型模式;

import jdk.jfr.DataAmount;

import java.security.SecureRandom;

/**
 * @description:
 * @author: asd
 * @time: 2022/11/23 19:56
 */
public class thing1 implements Cloneable{
    private String name;
    private String dis;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDis() {
        return dis;
    }

    public void setDis(String dis) {
        this.dis = dis;
    }

    public thing1() {
        System.out.println("构造器被执行");
    }
    public Object clone() throws CloneNotSupportedException {
        System.out.println("克隆成功");
        return (thing1)super.clone();
    }
}
class test{
    public static void main(String[] args) throws CloneNotSupportedException {
        thing1 t1 = new thing1();
        thing1 t2 = (thing1) t1.clone();
    }
}
